import { createI18n } from 'vue-i18n';
import en from './en-US';
import cn from './zh-CN';
import cnHK from './zh-HK';

export const LOCALE_OPTIONS = [
    { label: '中文', value: 'zh-CN' },
    { label: '中文-繁體', value: 'zh-HK' },
    { label: 'English', value: 'en-US' },
];
const defaultLocale = localStorage.getItem('enric-locale') || 'zh-CN';

const i18n = createI18n({
    locale: defaultLocale,
    fallbackLocale: 'zh-CN',
    legacy: false,
    allowComposition: true,
    messages: {
        'en-US': en,
        'zh-CN': cn,
        'zh-HK': cnHK,
    },
});

export default i18n;
